<template>
  <el-scrollbar class="emoji">
    <div class="emoji-default">
      <span
        class="item_emoji"
        v-for="(item, index) in emoji"
        :key="index"
        @click.stop="chooseEmojiDefault(item)"
      >
        {{ item }}
      </span>
    </div>
  </el-scrollbar>
</template>
<script lang="ts" setup>
import { ref, reactive } from "vue";
import emojiJson from "@/assets/js/emoji.json";
const emit = defineEmits(["choose"]);
const emoji = reactive(emojiJson.data.split(","));
const chooseEmojiDefault = (data: string) => {
  emit("choose", data);
};
</script>
<style lang="scss" scoped>
.emoji {
  text-align: left;
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid #dcdfe6;
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 12%), 0 0 6px 0 rgb(0 0 0 / 4%);
  .emoji-default {
    padding: 10px;
    height: 200px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    .item_emoji {
      display: block;
      padding: 5px;
      font-size: 24px;
      width: 29px;
      height: 29px;
      overflow: hidden;
      cursor: pointer;
      &:hover {
        background-color: #d5d5d5;
      }
    }
  }
}
</style>
